@import (reference) '../../styles/variables.less';

.@{prefix}-sidebar {
  position: sticky;
  top: @s-header-height;
  // width: @s-sidebar-width;
  padding-top: 20px;
  
  padding-inline-start: 8px;
  box-sizing: border-box;
  height: calc(100vh - @s-header-height);  
  .simplebar-content {
    width: 180px;
  }
  .simplebar-content-wrapper {
    padding-bottom: 130px;
  }
  @media @mobile {
    position: fixed;
    z-index: 20;
    top: 0;
    left: 0;
    bottom: 0;
    max-height: initial;
    padding-inline-start: 32px;
    background-color: @c-site-bg;
    border-top: 1px solid @c-border-light;
    box-shadow: 0 0 20px rgba(0, 0, 0, 10%);
    transition: 0.2s all;

    @{dark-selector} & {
      background-color: @c-site-bg-dark;
      border-top-color: @c-border-less-dark;
    }

    .@{prefix}-doc-layout:not([data-mobile-sidebar-active]) & {
      opacity: 0;
      visibility: hidden;
      transform: translateX(-100%);
    }
  }

   dl {
    margin: 0;
    padding: 0;
    line-height: 1;

    dt {
      margin: 8px 0;
      color: @c-text;
      font-size: 14px;
      font-weight: bold;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      text-transform: uppercase;

      @{dark-selector} & {
        color: @c-text-dark;
      }
    }

    > dd {
      margin: 0;
      padding: 8px 0;
      
      > a {
        display: block;
        color: @c-text-secondary;
        font-size: 16px;
        line-height: 20px;
        text-decoration: none;
        transition: all 0.3s;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;

        @{dark-selector} & {
          color: @c-text-secondary-dark;
        }

        &:hover {
          color: @c-primary;
         
        }

        &.active {
          color: @c-primary;
          font-weight: bold;
          @{dark-selector} & {
            color: @c-primary-dark;
          }
        }
      }
    }

    // divider line & gap
    + dl {
      margin-top: 16px;
      padding-top: 16px;
      border-top: 1px solid @c-border;

      @{dark-selector} & {
        border-top-color: @c-border-dark;
      }
    }
  }
}